package edu.gdkm.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import edu.gdkm.pojo.Company_info;
import org.springframework.stereotype.Repository;


@Repository
public interface CompanyInfoDao {
    @Select("select * from company_info where id=#{id}")
    Company_info findById(Integer id);

    @Select("select * from company_info")
    Company_info[] findAll();

    @Insert("insert into company_info(user_id,company_name,industry,scale,nature,introduction,address,website,contact_person,create_time,update_time) values(#{user_id},#{company_name},#{industry},#{scale},#{nature},#{introduction},#{address},#{website},#{contact_person},#{createTime},#{updateTime})")
    boolean save(Company_info company_info);

    @Update("update company_info set user_id=#{user_id},company_name=#{company_name},industry=#{industry},scale=#{scale},nature=#{nature},introduction=#{introduction},address=#{address},website=#{website},contact_person=#{contact_person},update_time=#{updateTime} where id=#{id}")
    boolean update(Company_info company_info);

    @Delete("delete from company_info where id=#{id}")
    boolean delete(Integer id);
}
